<?php
include_once('common/header.php');			
if($AppUI->id <=0 || isset($_SERVER['HTTP_REFERER'])) {
	Vfriend_Function::redirect(HOST_VFRIEND);
}
$strRefer		= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$intNewsId	= $objRequest->getParam('newsid', 0);
$strToken	= $objRequest->getParam('token', '');
$strSession	= isset($_SESSION['newsDel' . $intNewsId]) ? $_SESSION['newsDel' . $intNewsId] : '';
$intError	= 0;
if($intError == 0 && $intNewsId && $strToken != '' && $strToken == $strSession && Vfriend_Function::isValidLink($strRefer)) {
	unset($_SESSION['newsDel' . $intNewId]);
	$objNews	= new News();
	$intError	= $objNews->delete($AppUI->id, $intNewsId);
	if($intError == 0) {
		Vfriend_Function::setMsg($arrMessage[10]);
		Vfriend_Function::redirect(LINK_NEWS);
	} else 
		$intError = 13;
} else {
	$intError = 12;
}
if($intError > 0) {
	$strError = $arrError[$intError];	
	Vfriend_Function::setError($strError);
	Vfriend_Function::redirect($strRefer ? $strRefer : LINK_NEWS);
}

?>
